# Maintainer: Alexey Pavlov <alexpux@gmail.com>

pkgname=gawk
pkgver=4.1.3
pkgrel=1
pkgdesc="GNU version of awk"
arch=('i686' 'x86_64')
url="http://www.gnu.org/software/gawk/"
license=('GPL')
groups=('base' 'base-devel')
depends=('sh' 'mpfr' 'libintl' 'libreadline')
makedepends=('gettext-devel' 'mpfr-devel' 'libreadline-devel')
provides=('awk')
install=gawk.install
source=(ftp://ftp.gnu.org/pub/gnu/${pkgname}/${pkgname}-${pkgver}.tar.gz{,.sig}
        gawk-4.1.1-autotools.patch)
md5sums=('55d37f4069502677f25d1340df8eec97'
         'SKIP'
         'd865059f5468d4e4260c94349fe8776c')

prepare() {
  cd ${srcdir}/${pkgname}-${pkgver}
  patch -p1 -i ${srcdir}/gawk-4.1.1-autotools.patch

  #gettextize -f
  autoreconf -fi
}

build() {
  cd ${srcdir}/${pkgname}-${pkgver}
  ./configure --build=${CHOST} \
              --prefix=/usr \
              --libexecdir=/usr/lib \
              --without-libiconv-prefix \
              --without-libintl-prefix \
              --without-libsigsegv

  make
}

check() {
  cd ${srcdir}/${pkgname}-${pkgver}
  make check
}

package() {
  cd ${srcdir}/${pkgname}-${pkgver}
  make DESTDIR=${pkgdir} install
}
